<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
     <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>前台财务总控</title>

<link rel="stylesheet" href="/bsc/js/common/bootstrap/css/bootstrap.min.css">
<link rel="stylesheet" href="/bsc/js/common/bootstrap/css/bootstrap-theme.min.css">
<script src="/bsc/js/common/bootstrap/js/jquery-3.1.1.min.js"></script>
<script src="/bsc/js/common/bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<form action="" method="post" >
 <table border="0" align="center">
     <tr>
     <td style="padding-right:5px">月目标现金收入:</td><td style="padding-right:100px">${list2.month_cash_in }</td>
     <td style="padding-right:5px">月目标消耗收入:</td><td style="padding-right:100px">${list2.month_expend_in }</td>
     </tr>
      <tr>
     <td >现金收入:</td><td>${list2.cash_income }</td>
     <td>消耗收入:</td><td>${list2.extend_income }</td>
     </tr>
      <tr>
     <td style="padding-right:5px">现金收入完成率:</td><td><font style="color: red">${list2.bm }%</font></td>
     <td style="padding-right:5px">消耗收入完成率:</td><td><font style="color: red">${list2.em }%</font></td>
     </tr>
     </table>
     </form>
<form method="post">
<table border="1" width="100%" align="center">
<tr>
<td colspan="12">
<button id="export" type="button" class="btn btn-primary" ><span class="glyphicon glyphicon-pencil"></span>导出Excel</button>
</td>
</tr>
</table>
<table class="table table-striped" class="table table-hover" id="tab">
<tr>
<td>订单编号</td>
<td>交易时间</td>
<td>顾客账号</td>
<td>顾客姓名</td>
<td>交易内容</td>
<td>价格</td>
<td>实付金额</td>
<td>消耗颜值</td>
<td>支付方式</td>
<td>现金收入</td>
<td>消耗收入</td>
</tr>
<c:forEach items="${info.list }" var="bo">
<tr id="tb">
<td>${ bo.order_id }</td> 
<td>${bo.pay_time }</td>
<td>${bo.custom_user_id }</td>
<td>${bo.username}</td> 
<td>${bo.order_content }</td>
<td>${bo.order_money }</td>
<td>${bo.pay_money}</td>
<td>${bo.extend_beauty_num}</td>
<td>
<c:if test="${bo.pay_way=='1'}">微信</c:if>
<c:if test="${bo.pay_way=='2'}">支付宝</c:if>
<c:if test="${bo.pay_way=='3'}">美研币</c:if>
<c:if test="${bo.pay_way=='4'}">套餐</c:if>
</td>
<td>${bo.cash_income}</td>
<td>${bo.extend_income}</td>
</tr>
</c:forEach>
</table>
 <a href="javascript:;" class="layui-btn layui-btn-normal" onclick="up()">上一页</a>   
 <a class="layui-btn layui-btn-normal" href="javascript:;" onclick="next()" >下一页</a>
</form>
<form method="post" id="zhangnuo">

</form>
</body>
</html>
<script  type="text/javascript">
$("#exportExcel").on("click",function(){
	var url = "http://localhost:8081/bsc/proltal/zn1/Excel1";
	$("#zhangnuo").attr("action",url);
	$("#zhangnuo").submit();
});


$(function(){
	  $('#export').click(function(){
			var trNum=$("#tab").find("tr").length ;//获取表格行数
			var tdNum=$("#tab").find("tr:eq(0)").find("td").length;//获取表格列数
			var arr="";
			for(i=0;i<trNum;i++){
				var str="";
				for(j=0;j<tdNum;j++){
					var info=$("#tab tr:eq("+i+") td:eq("+j+")").text();
					str=str+info+",";
				}
				str=str.substring(0,str.length-1);
				arr=arr+str+"%26";
			}
			window.location.href="/bsc/proltal/zn1/export2?arr="+arr;
	});
	  
	
	  
});

//上一页
function up(){
	document.forms[0].action="/bsc/proltal/zn1/findbisinessordel?page="+${info.prePage};
	document.forms[0].submit();
};
//下一页
function next(){
	document.forms[0].action="/bsc/proltal/zn1/findbisinessordel?page="+${info.nextPage};
	document.forms[0].submit();
};
</script>